package com.devilvan.betrice.poetry.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.devilvan.betrice.common.BasePo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.hibernate.annotations.DynamicInsert;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.Table;
import java.io.Serial;
import java.io.Serializable;

/**
 * @author Evad.Wu
 * @Description 古诗文网-头信息表 映射
 * @date 2022-11-29
 */
@Setter
@Getter
@ToString
@NoArgsConstructor
@Accessors(chain = true)
@TableName(value = "POETRY_HEADER")

@Entity
@Table(name = "POETRY_HEADER")
@DynamicInsert
@EntityListeners(AuditingEntityListener.class)
@Schema(description = "古诗文网-头信息表 映射")
public class PoetryHeaderPo extends BasePo implements Serializable {
    @Serial
    private static final long serialVersionUID = -7890716854089469765L;
    @Schema(description = "关键字（类型、作者、朝代、形式）")
    @TableField(value = "KEYWORD")
    @Column(name = "KEYWORD", columnDefinition = "VARCHAR(32) NOT NULL COMMENT '关键字（类型、作者、朝代、形式）'")
    private String keyword;
    @Schema(description = "主标题")
    @TableField(value = "TITLE")
    @Column(name = "TITLE", columnDefinition = "TEXT(65,535) NOT NULL COMMENT '主标题'")
    private String title;
    @Schema(description = "诗经、乐府、楚辞会有副标题")
    @TableField(value = "SUB_TITLE")
    @Column(name = "SUB_TITLE", columnDefinition = "TEXT(65,535) COMMENT '诗经、乐府、楚辞会有副标题'")
    private String subTitle;
    @Schema(description = "作者")
    @TableField(value = "AUTHOR")
    @Column(name = "AUTHOR", columnDefinition = "VARCHAR(32) COMMENT '作者'")
    private String author;
    @Schema(description = "朝代")
    @TableField(value = "DYNASTY")
    @Column(name = "DYNASTY", columnDefinition = "VARCHAR(16) COMMENT '朝代'")
    private String dynasty;
    @Schema(description = "内容URL")
    @TableField(value = "DETAIL_URL")
    @Column(name = "DETAIL_URL", columnDefinition = "TEXT COMMENT '内容URL'")
    private String detailUrl;
}
